Skip to main content

DigiLocker Consent URL API

The following document highlights the details of the DigiLocker Consent URL API.

API Description

Objective

The DigiLocker Consent URL API, also known as the Start API, initiates the customer consent-seeking process through a URL that grants HyperVerge the access to the documents within their DigiLocker account.

InputOutput
A unique reference identifier and redirect URL to initiate the DigiLocker consent processA consent URL that grants HyperVerge access to documents within the user's DigiLocker account

API URL

https://ind-verify.hyperverge.co/api/digilocker/start

API Endpoint

start

Overview

The DigiLocker Consent URL API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Method - POST

Authentication

You need a unique pair of application ID ( appId ) and application key ( appKey ) from HyperVerge to verify your identity for accessing the API.

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-type MandatoryThis parameter defines the media type for the request payloadapplication/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
transactionIdOptionalA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Inputs

The following table provides the details of the parameters required for the DigiLocker Consent URL API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
referenceIdMandatorystringThe unique reference identifierNot ApplicableNot Applicable
redirectURLOptionalstringThe URL to which the user will be redirected after completionNot ApplicableNot Applicable
flowOptionalstringThe parameter enables you to direct users to Sign In or Sign Up screensNot ApplicableNot Applicable
useCustomAuthFlowOptionalstringThe parameter to enable the custom authorization flow. When set to yes, users are directed to your custom authorization flow instead of HyperVerge default screens. The parameter is recommended to maintain a consistent user experience within your applicationNot Applicableno
usePinlessAuthOptionalstringThe parameter to enable DigiLocker PIN-less authentication. When set to yes, users can authenticate without entering a PINNot ApplicableNot Applicable
returnSummaryOptionalstringThe parameter to control whether a summary is returned in the response. When set to yes, the API response includes a summaryNot ApplicableNot Applicable
enableDarkModeOptionalstringThe parameter to enable the HyperVerge SDK dark mode. When set to yes, the SDK screen displays in dark modeNot ApplicableNot Applicable

Request

The following code snippet demonstrates a standard curl request for the DigiLocker Consent URL API:

curl --location --request POST 'https://ind-verify.hyperverge.co/api/digilocker/start' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--data-raw '{
"referenceId": "<Enter_the_Reference_ID>",
"redirectURL": "<Enter_the_Redirect_URL>",
"useCustomAuthFlow": "<Enter_yes_or_no>",
"usePinlessAuth": "<Enter_yes_or_no>",
"flow": "<signin_or_signup>"
}'

Success Response

The following code snippet demonstrates a success response from the DigiLocker Consent URL API:

{
"status": "success",
"statusCode": "200",
"result": {
"url": "<The_consent_URL_string>"
}
}

Success Response Details

The following table outlines the details of the success response from the DigiLocker Consent URL API:

ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code for the response
resultobjectThe JSON object containing the consent URL
result.urlstringThe DigiLocker URL that seeks permission from the customer to provide HyperVerge with the consent to access their documents
info

For Sign In flows, if a user has already completed the flow and provided full consent to all documents in the consent screen, DigiLocker caches this consent for 15 minutes.
During this period, if the user initiates another Sign In flow, they will bypass the consent screen as the system recognizes that full consent has already been provided for all documents. Users won't see the consent screen again until the 15-minute cache period expires or if they attempt to access documents that weren't previously consented to.

Error Responses

The following are some error responses from the DigiLocker Consent URL API:

{
"status": "failure",
"statusCode": "401",
"error": "Missing/Invalid credentials"
}

Error Response Details

A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:

Status CodeError MessageError DescriptionError Resolution
400ER_REQ_VALIDATE / Bad RequestThe request is missing required parameters or has invalid values, or metadata for DigiLocker credentials does not existProvide all mandatory parameters in the request or ensure DigiLocker credentials are configured using the Credentials API
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid valuesProvide valid appId and appKey credentials in the request
500Internal Server ErrorThere was an error with HyperVerge's serverPlease check the request headers or contact the HyperVerge team for resolution

PIN-less Authentication

The following section provides a detailed explanation of DigiLocker PIN-less authentication and how it works.

What is PIN-less flow?

The DigiLocker PIN-less flow enables end users to retrieve their identity documents without requiring a six-digit Security PIN during authentication. This flow bypasses the standard PIN-based authentication mechanism by leveraging Single Sign-On (SSO) integration. It is Implemented through integration with the MeriPehchaan platform

Enable PIN-less Flow

To enable PIN-less authentication, set the parameter usePinlessAuth to yes in the API request body.

Use Case

The PIN-less flow is optimized for streamlining the sign-in process for existing DigiLocker users. By eliminating the need to enter a six-digit Security PIN, it significantly reduces authentication friction and enables faster access to documents. Users who already have documents stored in their DigiLocker account can leverage this flow for quick sign-in and document retrieval.

Note: The sign-up journey via PIN-less flow does not include UIDAI or NSDL integration, so document fetching during initial account creation is not available.

PIN-less vs PIN-based Authentication

The following table compares the key differences between PIN-based and PIN-less authentication flows:

FeaturePIN-based FlowPIN-less Flow
PurposeUsed for signing-in, signing-up, and fetching new documents from issuing authorities like UIDAI/NSDLSimplifies sign-in to fetch documents already in the Digilocker Vault
Authentication MethodRequires a six-digit security PIN for validationNo PIN is required; leverages Single Sign-On (SSO) via the MeriPehchaan platform
Document FetchingSupports fetching new Aadhaar/PAN/DL cards from issuing authoritiesLimited to fetching Aadhaar/PAN/DL cards already present in the Digilocker Vault
LimitationsRequires users to remember and enter the PINDoes not support document fetching during sign-up or new document access
AdvantagesFull functionality for onboarding and document retrievalEnhanced user convenience and faster sign-in experience

PIN-less Flow Demo

The following demo video illustrates the DigiLocker PIN-less authentication flow with example UI screens:



PIN-less Authentication and Sign Up Flow

We strongly discourage using the combination of PIN-less authentication (usePinlessAuth: "yes") with the Sign Up flow (flow: "signup").

The PIN-less flow is optimized for existing DigiLocker users who already have documents in their account, and it does not support document fetching during the sign-up process. Using this combination can result in a suboptimal user experience and may prevent successful document retrieval.

Recommended approach: Orchestrate the authentication flow based on user type. Use PIN-less authentication for existing users (sign-in flow) and PIN-based authentication for new users (sign-up flow) to ensure optimal functionality and user experience.

Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: